import requests

# 向资源URL发送一个GET请求
r = requests.get('https://www.baidu.com/favicon.ico')
with open('favicon.ico', 'wb') as f:
    f.write(r.content)

print(r.json())
